package com.example;

import java.util.ArrayList;
import java.util.List;

public class Pmd_and_checkstyleExample {

    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("apple");
        list.add("banana");
        list.add("orange");

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }

        try {
            int result = divide(10, 0);
            System.out.println("Result: " + result);
        } catch (ArithmeticException e) {
            System.out.println("Cannot divide by zero!");
        }
    }

    // Method to perform division
    private static int divide(int x, int y) {
        return x / y;
    }
}
